//
//  RecPKParamap.m
//  WuLi
//
//  Created by Gollum on 16/09/09
//  Copyright (c) Gollum. All rights reserved.
//

#import "RecPKParamap.h"
#import "RecPKVotestatisticinfo.h"
#import "RecPKVotedetailinfo.h"
@implementation RecPKParamap

+ (NSDictionary *)objectClassInArray{
    return @{@"voteStatisticInfo" : [RecPKVotestatisticinfo class]};
}
- (void)setValue:(id)value forKey:(NSString *)key{
    [super setValue:value forKey:key];
    NSMutableArray <RecPKVotestatisticinfo *> *votesDetail = [NSMutableArray array];
    NSArray *valueArray = value;
    //字典
    if ([key isEqualToString:@"voteDetailInfo"]) {
        _voteDetailInfo = [RecPKVotedetailinfo modelWithDic:value];
    }
    //数组
    if ([key isEqualToString:@"voteStatisticInfo"]) {
        for (NSDictionary *dic in valueArray) {
            RecPKVotestatisticinfo *votes = [RecPKVotestatisticinfo modelWithDic:dic];
            [votesDetail addObject:votes];
        }
        _voteStatisticInfo = votesDetail;
    }
}
@end
